package com.itstyle.quartz.interceptor;

import com.itstyle.quartz.entity.QuartzEntityBatchDt;
import org.quartz.JobKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.Properties;

public class MyTask  implements Runnable
{
    private static final Logger logger = LoggerFactory.getLogger(MyTask.class);
    List<QuartzEntityBatchDt> id;
    JobKey jobkeys;


    public MyTask(List<QuartzEntityBatchDt> id, JobKey jobkeys)
    {
        this.id = id;
        this.jobkeys=jobkeys;
    }

    public void run()
    {
        //调用业务类
        CompareTableBatch compareTableBatch = new CompareTableBatch();
        try {
            logger.info("开始创建线程！ jobkeys="+jobkeys);
            compareTableBatch.runBatchJob(id,jobkeys);
        } catch (Exception e) {
            logger.error("创建线程异常 jobkeys="+jobkeys+e.getMessage());
        }
    }
}